package com.cll.prototype.user.controller;

import com.cll.prototype.common.dto.AjaxResult;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 描述信息:
 *
 * @author CLL
 * @version 1.0
 * @date 2020/11/10 16:00
 */
@RestController
@RequestMapping(value = "/config")
@RefreshScope
public class ConfigController {

    @Value("${author.name}")
    private String authorName;

    @Value("${author.age}")
    private String authorAge;

    @Value("${author.email}")
    private String authorEmail;

    @Value("${ext.version}")
    private String extendVersion;

    @GetMapping(value = "/getConfig")
    public AjaxResult getConfig(){
        return AjaxResult.success(20, "获取配置成功", authorName + ":" + authorAge + ":" + authorEmail + ":" + extendVersion);
    }
}
